#include <iostream>
#include <cmath>
#include <string>
using namespace std;
bool check(long num)
{
    for (int i = 2; i <= sqrt(num); i++)
        if (num % i == 0) return false;
    return true;
}
int main()
{
    long n;
    string ret;
    cin >> n;
    cout << n << '=';
    int cnt = 0, num = 2, k = 0;
    while (n)
    {
        cnt = 0;
        bool flag = false;
        while (n % num == 0)
        {
            flag = true;
            cnt++;
            n /= num;
        }
        if (flag)
        {
            if (k > 0)
                cout << '*';
            cout << num;
            k++;
            if (cnt > 1)
                cout << '^' << cnt;
        }

        num++;
        while (!check(num))
        {
            num++;
        }
        if (n == 1)
            break;
    }
    return 0;
}